from selenium import webdriver
from pprint import pprint
import os
import time

driver = webdriver.Chrome()

resource_path = os.path.abspath('resource')

url = os.path.join(resource_path, 'xpath定位页面.html')

driver.get(url)


time.sleep(2)

print(driver.find_element_by_xpath('//ul/li').get_attribute('outerHTML'))

driver.quit()